package javacafe.action.studybbs;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.studybbs.StudyBBSReplyDTO;
import javacafe.service.StudyBBSService;
import javacafe.serviceimple.StudyBBSServiceImpl;

public class ReplyListAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionForward forward = new ActionForward();
		forward.setUrl("replylist");
		
		int sp_no = Integer.parseInt( request.getParameter("sp_no") );
		StudyBBSService service = StudyBBSServiceImpl.getInstance();
		List<StudyBBSReplyDTO> replylist = service.getReplyList(sp_no);

		request.setAttribute("replylist", replylist);
		
		return forward;
	}

}
